export default {
  bind (el, binding, vNode, oldVNode) {
    const rules = (binding.value && binding.value.rules) || []
    const name = (binding.value && binding.value.name)
    if (name) {
      el.name = name
    }

    const rule = rules.find(rule => rule.hasOwnProperty('required'))
    if (rule && rule.required) {
      console.log(el, binding, vNode, oldVNode)
    }
  },
  inserted (el, binding, vNode, oldVNode) {
    console.log('inserted', el, binding, vNode, oldVNode)
  },
  update (el, binding, vNode, oldVNode) {
    console.log('update', el, binding, vNode, oldVNode)
  }
}
